package a.f;

import a.c.d;
import a.c.e;
import a.c.k;
import a.c.m;
import a.d.w;

public class fb
  extends r
  implements vc
{
  protected double g = 0.2D;
  public static int h;
  
  public fb()
  {
    super(null);
  }
  
  public fb(rc paramrc)
  {
    super(paramrc);
  }
  
  public boolean canLayout(o paramo)
  {
    boolean bool = o.eg;
    if (paramo != null) {
      if ((bool) || (a() != null)) {
        if (bool) {
          break label37;
        }
      }
    }
    label37:
    return a().canLayout(paramo);
  }
  
  public void doLayout(o paramo)
  {
    rc localrc = a();
    if (!o.eg)
    {
      if (localrc != null) {
        localrc.doLayout(paramo);
      }
      c(paramo);
    }
  }
  
  protected void c(o paramo)
  {
    boolean bool = o.eg;
    int j = o.dg;
    k localk1 = paramo.c(ec.a);
    k localk2 = paramo.c(ec.b);
    k localk3 = paramo.c(ed.a);
    k localk4 = paramo.c(ed.b);
    m localm = paramo.w();
    label170:
    label172:
    label505:
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      zb localzb = paramo.e(locald);
      ec localec = null;
      if ((localk1 != null) && ((bool) || (!a(localk3, locald)))) {
        localec = (ec)localk1.get(locald);
      }
      Object localObject;
      w localw1;
      w localw3;
      w localw4;
      double d11;
      if (localec != null)
      {
        localObject = locald.e();
        if ((bool) || (localzb.a() > 0))
        {
          if (bool) {
            break label170;
          }
          localw1 = localzb.a(0);
          if (j == 0) {
            break label172;
          }
        }
        localw1 = paramo.s(locald);
        w localw2 = paramo.r(locald);
        double d2 = localw2.a;
        double d4 = localw2.b;
        double d6 = d2 - localw1.a;
        double d8 = d4 - localw1.b;
        double d10 = Math.sqrt(d6 * d6 + d8 * d8);
        if (!bool)
        {
          if (d10 > 0.001D) {
            d6 /= d10;
          }
        }
        else
        {
          d8 /= d10;
          localw3 = paramo.o((e)localObject);
          localw4 = localec.a(paramo.d(localObject), d2 - localw3.a, d4 - localw3.b, d6, d8);
          if ((localw4 != null) && (!a(localw3.a + localw4.a, localw3.b + localw4.b, d2, d4)))
          {
            d11 = d8 * (localw3.a + localw4.a - localw1.a) - d6 * (localw3.b + localw4.b - localw1.b);
            if (!bool)
            {
              if (Math.abs(d11) > 0.001D) {
                localzb.a(localw2.a, localw2.b);
              }
            }
            else
            {
              int i = localzb.a() - 1;
              if (i > 0) {}
              while (bool)
              {
                w localw5 = localzb.a(i - 1);
                localzb.a(i, localw5.a, localw5.b);
                i--;
                if ((!bool) && (j != 0)) {
                  break label505;
                }
                if (j == 0) {
                  break;
                }
              }
              localzb.a(0, localw2.a, localw2.b);
            }
            paramo.a(locald, localw4);
          }
        }
      }
      localec = null;
      if ((localk2 != null) && ((bool) || (!a(localk4, locald)))) {
        localec = (ec)localk2.get(locald);
      }
      if (localec != null)
      {
        if ((bool) || (localzb.a() > 0))
        {
          if (bool) {
            break label605;
          }
          localObject = localzb.a(localzb.a() - 1);
          if (j == 0) {
            break label607;
          }
        }
        localObject = paramo.r(locald);
        localw1 = paramo.s(locald);
        double d1 = localw1.a;
        double d3 = localw1.b;
        double d5 = d1 - ((w)localObject).a;
        double d7 = d3 - ((w)localObject).b;
        double d9 = Math.sqrt(d5 * d5 + d7 * d7);
        if (bool) {
          continue;
        }
        if (d9 > 0.001D)
        {
          d5 /= d9;
          d7 /= d9;
          e locale = locald.f();
          localw3 = paramo.o(locale);
          localw4 = localec.a(paramo.d(locale), d1 - localw3.a, d3 - localw3.b, d5, d7);
          if (bool) {
            continue;
          }
          if (localw4 != null)
          {
            if (bool) {
              continue;
            }
            if (!a(localw3.a + localw4.a, localw3.b + localw4.b, d1, d3))
            {
              d11 = d7 * (localw3.a + localw4.a - ((w)localObject).a) - d5 * (localw3.b + localw4.b - ((w)localObject).b);
              if (Math.abs(d11) > 0.001D) {
                localzb.a(localw1.a, localw1.b);
              }
              paramo.b(locald, localw4);
            }
          }
        }
      }
      localm.f();
    } while (j == 0);
    label605:
    label607:
    return;
  }
  
  protected boolean a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    boolean bool = o.eg;
    if ((bool) || (Math.abs(paramDouble1 - paramDouble3) < this.g)) {
      if (bool) {}
    }
    return Math.abs(paramDouble2 - paramDouble4) < this.g;
  }
  
  boolean a(k paramk, d paramd)
  {
    boolean bool = o.eg;
    if ((bool) || (paramk != null))
    {
      if (bool) {
        break label44;
      }
      if ((paramk.get(paramd) instanceof cd)) {
        return ((cd)paramk.get(paramd)).a();
      }
    }
    label44:
    return false;
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.fb
 * JD-Core Version:    0.7.0.1
 */